package com.yzf.demo.demo.ReflectionMechanism;

import lombok.Data;

import java.lang.annotation.Annotation;

/**
 * Created by 于占峰 on 2020/3/25/025.
 */
public class GetAnnotation {
    public static void main(String[] args) {
        Class clazz = DemoBean.class;
        Annotation annotation = clazz.getAnnotation(Data.class);
        Annotation[] annotations = clazz.getAnnotations();
        System.out.println(annotation);
        System.out.println(annotations);
    }
}
